
<%@page language="java"import="java.util.*"pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
<%-- <base href="<%=basePath%>"> --%>

<title>角色管理</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<link rel="stylesheet" href="../assets/css/portal.css" />
<link rel="stylesheet" href="../assets/css/zTreeStyle/metro.css">
<script src="../assets/js/jquery.ztree.all-3.5.min.js"></script>
<script src="../assets/js/sysManage.js"></script>
<script src="../assets/js/roleRefresh.js"></script>
</head>
<body>
	<div class="widget-header  bordered-bottom bordered-blue">
		<span class="widget-caption">角色管理</span>
	</div>
	<div class="widget-body">
		<div class="docs-example">
			<form id="accountForm" method="post" class="form-horizontal bv-form"
				novalidate="novalidate" action="">
				<div class="form-group">
					<label class="col-sm-1 control-label">角色名称</label>
					<div class="col-sm-2">
						<input type="text" class="form-control" id="findrolename" value="${rolename }">
					</div>
<!-- 					<label class="col-sm-1 control-label">名称</label>
					<div class="col-sm-2">
						<input type="text" class="form-control" id="">
					</div>
					<label class="col-sm-1 control-label">时间</label>
					<div class="col-sm-2">
						<input type="text" class="form-control" id="">
					</div> -->
					<div class="col-sm-2">
						<button type="button"
							class="btn btn-blue glyphicon glyphicon-search" onclick="findRole()">查询</button>
							<c:choose>
							<c:when test="${role_add == 'role_new' }">
								<button type="button" class="btn btn-blue glyphicon glyphicon-plus" id="addmodal" data-toggle="modal" data-target="#myModal">新建</button>
							</c:when>
							<c:otherwise>
								<button type="button" class="btn btn-blue glyphicon glyphicon-plus" id="addmodal" data-toggle="modal" data-target="#myModal" disabled="disabled">新建</button>
							</c:otherwise>
							</c:choose>
						
					</div>
				</div>

				<div class="widget">
					<div class="widget-header ">
						<span class="widget-caption">角色管理列表</span>
					</div>
					<div class="widget-body">
						<div role="grid" id="nodotable_wrapper"
							class="dataTables_wrapper form-inline no-footer">
						<!-- 	<div id="nodotable_length"
								style="text-align: right; margin-bottom: 5px;">
								<select name="nodotable_length" aria-controls="nodotable"
									class="form-control input-sm" id="pagesize" onchange="">
									<option value="10">1</option>
									<option value="25">2</option>
									<option value="50">50</option>
									<option value="100">100</option>
								</select>
							</div> -->
							<table class="table table-striped table-bordered table-hover">
								<thead>
									<tr>
										<th>编号</th>
										<th>角色名称</th>
										<th>创建时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach var="role" items="${roleList }">
									<tr>
										<td><c:out value="${role.role_id }"/></td>
										<td><c:out value="${role.role_name }"/></td>
										<td class="center "><c:out value="${role.createtime }"/></td>
										<td class=" ">
												<c:choose>
												<c:when test="${role_update=='role_edit' }">
													<button type="button" class="btn btn-info btn-xs"
														onclick="updfun('${role.role_id }')" data-toggle="modal" data-target="#updModal">
														<i class="fa fa-edit"></i> 编辑
													</button>
												</c:when>
												<c:otherwise>
													<button type="button" class="btn btn-info btn-xs"
														onclick="updfun('${role.role_id }')" data-toggle="modal" data-target="#updModal" disabled="disabled">
														<i class="fa fa-edit"></i> 编辑
													</button>
												</c:otherwise>
												</c:choose>
												<c:choose>
												<c:when test="${role_delete=='role_remove' }">
													<button type="button" class="btn btn-danger btn-xs " onclick="deleteRole('${role.role_id }')">
														<i class="fa fa-trash-o"></i> 移除
													</button>
												</c:when>
												<c:otherwise>
													<button type="button" class="btn btn-danger btn-xs " onclick="deleteRole('${role.role_id }')" disabled="disabled">
														<i class="fa fa-trash-o"></i> 移除
													</button>
												</c:otherwise>
												</c:choose>
											<%-- <button type="button" class="btn btn-info btn-xs"
												onclick="updfun('${role.role_id }')" data-toggle="modal" 
   data-target="#updModal">
												<i class="fa fa-edit"></i> 编辑
											</button>
											<button type="button" class="btn btn-danger btn-xs " onclick="deleteRole('${role.role_id }')">
												<i class="fa fa-trash-o"></i> 移除
											</button> --%>
										</td>
									</tr>
									</c:forEach>
								</tbody>
							</table>
							<div class="row DTTTFooter" style="margin-top:5px;">
								<div class="col-sm-6">
									<div class="dataTables_info" id="nodotable_info" role="alert"
										aria-live="polite" aria-relevant="all"
										style="line-height: 36px;">当前 ${pageNo }/${totalpage } 共${totalcount }条</div>
								</div>
								<div class="col-sm-6" style="text-align:right;">
									<div class="dataTables_paginate paging_bootstrap"
										id="nodotable_paginate">
										<ul class="pagination">
											<li class="prev"><a href="javascript:void(0);" onclick="pageturn('${prepage}')">上一页</a>
											</li>
											<li class="active"><a href="#">${pageNo }</a>
											</li>
											<li class="next"><a href="javascript:void(0);" onclick="pageturn('${nextpage}')">下一页</a>
											</li>
										</ul>
									</div>
								</div>
							</div>
						</div>
					</div>
					</div>
			</form>

		</div>
		<!--新建弹框-->
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">&times;</button>
						<h4 class="modal-title" id="myModalLabel">新建</h4>
					</div>
					<div class="modal-body">
						<form class="form-horizontal" id="rolemore">
							<input type="hidden" name="permfs" id="permfs"/>
							<input type="hidden" name="permps" id="permps"/>
							<input type="hidden" name="permgs" id="permgs"/>
							<input type="hidden" name="permts" id="permts"/>
							<div class="form-group">
								<label class="col-sm-2 control-label">角色名称</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="title" name="role_name">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">排序</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="pagetit" name="role_order">
								</div>
							</div>
							<div class="form-group" id="addfunlist">
								<label class="col-sm-2 control-label">功能权限</label>
								<jsp:include page="/jsp/tools/function.jsp" flush="true"/>
							</div>
							<div class="form-group" id="addporlist">
								<label class="col-sm-2 control-label">内容权限</label>
								<jsp:include page="/jsp/tools/portalrole.jsp" flush="true" />
							</div>
							<div class="modal-footer">
								<button type="button" class="btn btn-blue" id="addBtn"
									data-dismiss="modal" aria-hidden="true" onclick="saveRole()">添加</button>
								<button type="reset" class="btn btn-warning" id="resBtn">重置</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<!--编辑弹框-->
		<div class="modal fade" id="updModal" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">&times;</button>
						<h4 class="modal-title" id="updModalLabel">编辑</h4>
					</div>
					<div class="modal-body">
						<form class="form-horizontal" id="editrole">
							<input type="hidden" name="epermfs" id="epermfs"/>
							<input type="hidden" name="epermps" id="epermps"/>
							<input type="hidden" name="epermgs" id="epermgs"/>
							<input type="hidden" name="epermts" id="epermts"/>
							<input type="hidden" name="role_id" id="roleid"/>
							<input type="hidden" name="createtime" id="createtime"/>
							<div class="form-group">
								<label class="col-sm-2 control-label">角色名称</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="rolename" name="role_name">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">排序</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="roleorder" name="role_order">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">功能权限</label>
								<jsp:include page="/jsp/tools/editfunction.jsp" flush="true"/>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">内容权限</label>
								<jsp:include page="/jsp/tools/editportalrole.jsp" flush="true"/>
							</div>
							<div class="modal-footer">
								<button type="button" class="btn btn-blue" id="subBtn" data-dismiss="modal" aria-hidden="true">提交</button>
								<button type="button" class="btn btn-warning" data-dismiss="modal"
									aria-hidden="true">取消</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<!--详情弹框-->
		<div class="modal fade" id="detailModal" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">&times;</button>
						<h4 class="modal-title" id="detailModalLabel">详情</h4>
					</div>
					<div class="modal-body">
						<form class="form-horizontal">
							<div class="form-group">
								<label class="col-sm-2 control-label">标题:</label>
								<div class="col-sm-10">
									<label class="col-sm-2 control-label">标题</label>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">所属实例:</label>
								<div class="col-sm-10">
									<label class="control-label">所属实例</label>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		</div>
</body>
</html>


